
<div id="obsah"><p>Zadania:</p>
    <table border="1" cellspacing="0" width="80%" id="tabulkaZadani">
        <tr>
        <th width='50%'><h4>Názov zadania</h4></th> <th>Z učebnice</th> <th> Strana </th><th> Zadanie </th><th> Riešenie </th>
         </tr>
        <?php
          foreach ($tasks->result() as $t) {
        ?>
        <tr>
            <td width='50%'><h4><?php echo $t->name; ?></h4></td>
             <td><h4><?php echo $t->book_name; ?></h4></td>
             <td><?php echo $t->page; ?></td>
            <td>
                <?php
                if ($this->session->userdata('fk_role') == 2) { // moze mazat
                    echo "<a class='confirm' href='".base_url()."/tasks/deleteTask/$t->id'>Zmazať</a> ";
                } 
                echo "<a href='".base_url()."/tasks/view/$t->id'>Zobraziť</a>   ";
                 echo "<a href='".base_url()."/tasks/toPdf/$t->id'>PDF</a>   ";
                ?>
            </td>
            
            <td>
                <?php
                echo "<a href='".base_url()."/tasks/edit/$t->id'>Zobraziť</a>  ";
                if ($this->session->userdata('logged')) { 
                   echo "<a href='".base_url()."/tasks/solutionToPdf/$t->id'>PDF</a> ";
                }
                ?>
            </td>
        </tr>
        <?php
          }
        ?>

    </table>
</div>